<?php /* Smarty version 2.6.18, created on 2010-03-24 08:38:02
         compiled from order.tpl */ ?>

<div id="main_content">
    	<h1>Order</h1>
		<p style="vertical-align: top;">
		<div style="float:right;margin:0px px 0 0px;"><a href="javascript:void(0);" onclick="showCart();" stlyle="text-decoration:none" onclick=""><img src="/app/default/www/images/icon_cart.jpg" width="22" height="23" alt="()" border="0" /> &nbsp;view cart</a></div>
    		<div class="blue">    
    			<div style="float:right;">
    				<a href="javascript:void(0);" onclick="showsearch('search');">
    					<img id="show_arrow" alt="Show Search" src="/app/default/www/images/arrow-down.png" border="0"/>
    				</a>
    			</div>
    			<p class="left"><div style="display:block;" id="search">
        			<form name="mainForm" id="mainForm">
					<table border ="0" width="100%">
					<?php if ($this->_tpl_vars['countries']): ?>
						<tr>
							<td width="100">
								Country *:	
							</td>
							<td>
								<select style="width:150px;" name="search[country]" id="countries" onchange="searchOrganism(this.value);">
									<option value="">--- Select Country ---</option>
									<?php $_from = $this->_tpl_vars['countries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['country']):
?>                           
										<option value="<?php echo $this->_tpl_vars['country']['country_code']; ?>
" <?php if ($this->_tpl_vars['country']['country_code'] == $this->_tpl_vars['country_code']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['country']['country']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							
							</td>
						</tr>
					<?php else: ?>
						<!-- tr>
							<td width="100">
								FMA :	
							</td>
							<td>
								<select style="width:150px;" name="search[fma]" id="fma" onchange="searchOrganism(this.value);">
								<option value="">--- Select FMA ---</option>
									<?php $_from = $this->_tpl_vars['countries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['country']):
?>                           
										<option value="<?php echo $this->_tpl_vars['country']['country_code']; ?>
" <?php if ($this->_tpl_vars['country']['country_code'] == $this->_tpl_vars['country_code']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['country']['country']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							</td>
						</tr -->
					<?php endif; ?>		
						<tr>
							<td>
								Group:
							</td>	
							<td id=fishgroup>
								<select name="search[group]" id="group" onchange="document.getElementById('results').innerHTML='';doajaxAction('/account/searchorganismByCountry/groupid/'+this.value,0,'fishlist')">
										<option value="">--- Select Group ---</option>
										<?php $_from = $this->_tpl_vars['groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['organism']):
?>                           
											<option value="<?php echo $this->_tpl_vars['organism']['organism_group_id']; ?>
"><?php echo $this->_tpl_vars['organism']['organism_group']; ?>
</option>
										<?php endforeach; endif; unset($_from); ?>
									</select>	
							</td>
						</tr>				
						<tr>
							<td>
								Organism:
							</td>
							<td id="fishlist">				
								<select style="width:250px;" name="search" id="organism" onchange="document.getElementById('results').innerHTML=''">
									<option value="">--- Select Organism ---</option>
									<?php $_from = $this->_tpl_vars['organisms']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['organism']):
?>                           
										<option value="<?php echo $this->_tpl_vars['organism']['organism_id']; ?>
" <?php if ($this->_tpl_vars['organism']['organism_id'] == $this->_tpl_vars['organism_id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['organism']['name']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								Search criteria:
							</td>	
							<td>
								<input type="text" id="srchCriteria" value="" name="search[criteria]" style="width:250px;">
								<input type="button" value="SEARCH"  onclick="viewOrganism();"/>
							</td>
						</tr>	
						<tr>
							<td colspan="2"><input type="checkbox" name="specialorder" value="1" <?php if ($this->_tpl_vars['special_order']): ?>checked readonly <?php endif; ?> >&nbsp;Special Order</td>
						</tr>
						</div>
					</table>
                   </form> 
               
                </div></p>
        	</div><!-- blue -->
         </p>   
            <div id="results">
				           
                
     
            </div><!-- results -->
        
</div>

<script language="javascript">
<?php if ($this->_tpl_vars['cart'] == 1): ?>
	doajaxAction("/account/viewOrganism/searchFlg/0",0,"results");
<?php endif; ?>

	<?php echo '
	
	
		function viewOrganism() {
			var idForm = document.getElementById(\'mainForm\');
			doajaxAction("/account/viewOrganism/searchFlg/1",1,"results",idForm);
		}
		function searchOrganism(country){
		
			doajaxAction("/account/searchorganismGroupByCountry/country_code/"+country,0,"fishgroup");
			doajaxAction("/account/searchorganismByCountry/country_code/"+country,0,"fishlist");
			
			document.getElementById(\'results\').innerHTML=\'\';
		}
		
		function showCart(){
			doajaxAction("/account/showCart",0,"main_content");
		}
		
		function showsearch(div) {
			divid = document.getElementById(div);
			if(divid.style.display == \'none\') {
				divid.style.display = \'block\';
				document.getElementById(\'show_arrow\').src = "/app/default/www/images/arrow-up.png";
			} else {
				divid.style.display = \'none\';
				document.getElementById(\'show_arrow\').src = "/app/default/www/images/arrow-down.png";
			}
		}
		
	'; ?>

</script>